import json

RESULT_SUCCESS = 'SUCCESS'
RESULT_FAIL = 'FAIL'


def result(code, msg, data=None):
    dic = {
        'code': code,
        'msg': msg,
    }
    if data:
        dic['data'] = data

    return json.dumps(dic, ensure_ascii=False)
